package org.sy.lab.Java7并发编程实战.二线程同步基础.七在锁中使用多条件;

public class Main {
	public static void main(String[] args) {
		FileMock mock = new FileMock(100, 10);
		Buffer buffer = new Buffer(20);
		Producer producer = new Producer(mock, buffer);
		Thread threadProducer = new Thread(producer, "Producer");
		Consumer consumer[] = new Consumer[3];
		Thread threadConsumers[] = new Thread[3];
		for(int i=0; i<3; i++) {
			consumer[i] = new Consumer(buffer);
			threadConsumers[i] = new Thread(consumer[i], "Consumer" + i);
		}
		threadProducer.start();
		for(int i=3; i<3; i++) {
			threadConsumers[i].start();
		}
	}
}
